#include "stdafx.h"
#include "wf_select.h"

#include "pf_snapper.h"
#include "wf_selectsingle.h"


WF_Select::WF_Select(PF_Container& container,
                                 PF_GraphicView& graphicView,
                                 LX_Define::ActionType nextAction)
        :PF_ActionInterface("Select Entities", container, graphicView) {

    this->nextAction = nextAction;
}



void WF_Select::init(int status) {
	PF_ActionInterface::init(status);
	graphicView->setCurrentAction(
		new WF_SelectSingle(*container, *graphicView));
}



void WF_Select::mouseReleaseEvent(PF_MouseEvent* e) {
    if (e->button()==Qt::RightButton) {
        init(getStatus()-1);
    }
}



void WF_Select::updateToolBar() {
    if (PF_DIALOGFACTORY!=NULL) {
        if (!isFinished()) {
            PF_DIALOGFACTORY->requestToolBarSelect(this, nextAction);
        } else {
            PF_DIALOGFACTORY->requestToolBar(LX_Define::ToolBarMain);
        }
    }
}



// EOF
